#pragma once

#include "QSPrerequisites.h"
#include "QSSystems.h"

namespace QS
{
	class EngineImpl : public Engine, public EventListener
	{
	public:
		EngineImpl();
		virtual ~EngineImpl();

		void processEvent(const Event& evt);
		virtual void start();

		virtual GuiSystem* getGuiSystem();
		virtual GameSystem* getGameSystem();
		virtual ScriptSystem* getScriptSystem();
		virtual InputSystem* getInputSystem();
		virtual RenderSystem* getRenderSystem();
		virtual EventSystem* getEventSystem();
		virtual HostSystem* getHostSystem();

	private:	
		void initSystems();
		void updateSystems();
		void shutdownSystems();
		
		bool mDone;
		SystemFactory* mFactory;

		GuiSystem* mGui;
		GameSystem* mGame;
		ScriptSystem* mScript;
		InputSystem*  mInput;
		RenderSystem* mRender;
		EventSystem* mEvent;
		HostSystem* mHost;
	};
}